package org.hawk.gwtppc.webtest.tests.classsuite;

import java.lang.reflect.Modifier;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.AnnotationMock;
import org.hawk.gwtppc.webtest.tests.mock.ClassMock;
import org.hawk.gwtppc.webtest.tests.mock.EnumMock;
import org.hawk.gwtppc.webtest.tests.mock.InterfaceMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock1;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock2;

public class GetConstructorsTest implements Test {

	public void run() throws Throwable {
		Asserts.assertEquals(AnnotationMock.class.getConstructors().length, 0);
		Asserts.assertEquals(InterfaceMock.class.getConstructors().length, 0);
		Asserts.assertEquals(EnumMock.class.getConstructors().length, 0);
		Asserts.assertEquals(ClassMock[].class.getConstructors().length, 0);
		Asserts.assertEquals(ClassMock.class.getConstructors().length, 1);
		Asserts.assertEquals(ClassMock.class.getConstructors()[0].toString(), "public org.hawk.gwtppc.webtest.tests.mock.ClassMock()");
		Asserts.assertEquals(ClassMock.class.getConstructors()[0].getModifiers(), Modifier.PUBLIC);
		Asserts.assertEquals(SubClassMock1.class.getConstructors().length, 1);
		Asserts.assertEquals(SubClassMock1.class.getConstructors()[0].toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock1()");
		Asserts.assertEquals(SubClassMock1.class.getConstructors()[0].getModifiers(), Modifier.PUBLIC);
		Asserts.assertEquals(SubClassMock2.class.getConstructors().length, 2);
		Asserts.assertEquals(SubClassMock2.class.getConstructors()[0].toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(java.lang.String)");
		Asserts.assertEquals(SubClassMock2.class.getConstructors()[0].getModifiers(), Modifier.PUBLIC);
		Asserts.assertEquals(SubClassMock2.class.getConstructors()[1].toString(), "public org.hawk.gwtppc.webtest.tests.mock.SubClassMock2(int)");
		Asserts.assertEquals(SubClassMock2.class.getConstructors()[1].getModifiers(), Modifier.PUBLIC);
	}

	public String getName() {
		return "getConstructors()";
	}

}
